<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Iframe Title</title>
<meta charset=utf-8 />
<style type="text/css">
<!--
body {
-moz-box-shadow: 4px 4px 5px #888;
-webkit-box-shadow: 4px 4px 5px #888;
box-shadow: 4px 4px 5px #888;
}
-->
</style>
</head>
<body onload=sendSize() style='padding:5px;border-radius:10px;border:2px solid lightblue;background-color:transparent;margin:0;font-family:arial'>
<div id=containerDiv style=background-color:#ABCDEF>
<table style='width:360px'>

<tr>
<td>
<table style='width:100%;'>
<tr ><td id=drawBarGaugeTopTable style='width:90%' align=center ><span id=drawBarGaugeEditSpan>Draw Bar Gauges</span>
&nbsp; &nbsp; &nbsp; Scale:<select  onchange=parent.changeBarGauge()  id="barGaugeScaleSelect">
<option>1.0</option>
<option>0.9</option>
<option>0.8</option>
<option selected>0.7</option>
<option>0.6</option>
<option>0.5</option>
<option>0.4</option>
<option>0.3</option>
<option>0.2</option>
<option>0.1</option>
</select>

</td><td align=right> <button onClick=parent.closeDrawBarGauge()  >X</button></td></tr>
<tr><td  align=center colspan=2>

HMI Symbol SVG Source:<input type=checkbox  title="Show SVG source for this element"  id=sourceHMICheck  />


</td></tr>

</table>
</td>

</tr>


<TR><TD>

<table border=1 style='border-collapse: collapse;'>
<tr >
<td>Title</td>
<td><input  onkeyup=parent.changeBarGauge()  id=titleValue type="text" autocomplete="off"  style=width:200px; value="This is Gauge Title" /></td>
</tr>
<tr >
<td>Units</td>
<td><input onkeyup=parent.changeBarGauge()   id=unitValue type="text" autocomplete="off"  style=width:200px; value="degrees .F" /></td>
</tr >
<tr >
<td>Minimum Value</td>
<td><input onkeyup=parent.changeBarGauge()   id=minValue type="text" autocomplete="off"  style=width:100px; value="-20" /></td>
</tr>
<tr >
<td>Maximum Value</td>
<td><input onkeyup=parent.changeBarGauge()   id=maxValue type="text" autocomplete="off"  style=width:100px; value="120" /></td>
</tr>
<tr >
<td>Initial Value</td>
<td><input onkeyup=parent.changeBarGauge()   id=initValue type="text" autocomplete="off"  style=width:100px; value="115" /></td>
</tr>
<tr >
<td>Bar Color</td>
<td id=barColorBg><select id="barColorSelect" onChange=parent.barBarColorSelected()></select></td>
</tr>
<tr >
<td>Face Color</td>
<td id=faceColorBg><select id="faceColorSelect" onChange=parent.faceBarColorSelected()></select></td>
</tr>
<tr >
<td>Setpoint (optional)</td>
<td><input onkeyup=parent.changeBarGauge()   id=setPointValue type="text" autocomplete="off"  style=width:100px; value="58" /></td>
</tr>
<tr >
<td>maxAlert (optional)</td>
<td><input onkeyup=parent.changeBarGauge()   id=maxAlertValue type="text" autocomplete="off"  style=width:100px; value="105" /></td>
</tr>
<tr >
<td>minAlert (optional)</td>
<td><input onkeyup=parent.changeBarGauge()   id=minAlertValue type="text" autocomplete="off"  style=width:100px; value="-5" /></td>
</tr>


</table>
</TD></TR>

<tr  align=center>
<td>
	<button id=drawBarGaugeCancelButton disabled title='cancel/remove this circle' onClick=parent.cancelDrawBarGauge()>cancel</button>
    <button style='background-color:red;visibility:hidden' id=drawBarGaugeDeleteButton  onClick=parent.removeCurrentDrawBarGauge()>delete</button>
	<button id=drawBarGaugeTopButton style=background:white;font-size:120%;font-weight:bold;color:maroon;visibility:hidden  title='Move to top' onClick=parent.topDrawBarGauge()>&#x21E7;</button>
	<button id=drawBarGaugeBotButton style=background:white;font-size:120%;font-weight:bold;color:maroon   title='Move to bottom' onClick=parent.botDrawBarGauge()>&#x21E9;</button>

    <button id=drawBarGaugeFinishButton disabled onClick=parent.finishDrawBarGauge()>finish</button>
</td>
</tr>

</table>
</div>


</body>
<script>
function writeBarGaugeColorSelection()
{
   var DrawColors=parent.clrArray
	for(var k=0;k<DrawColors.length;k++)
	{
		var name=DrawColors[k][0]
		var myColor=DrawColors[k][1]
		var option=document.createElement("OPTION")
		option.style.backgroundColor=myColor
		option.value=myColor
		option.title=name+" "+myColor
                if(parent.hexString.indexOf(myColor)!=-1)
        option.style.color="white"
		option.text=k
        faceColorSelect.appendChild(option)

		var option=document.createElement("OPTION")
		option.style.backgroundColor=myColor
		option.value=myColor
		option.title=name+" "+myColor
                if(parent.hexString.indexOf(myColor)!=-1)
        option.style.color="white"
		option.text=k
       barColorSelect.appendChild(option)


	}

    faceColorSelect.selectedIndex=88  //---skyBlue---
    var clr=faceColorSelect.options[faceColorSelect.selectedIndex].value
   faceColorBg.style.backgroundColor=clr

   barColorSelect.selectedIndex=1 //---black---
   var clr=barColorSelect.options[barColorSelect.selectedIndex].value
   barColorBg.style.backgroundColor=clr

}



function sendSize()
{
   writeBarGaugeColorSelection()

   var width=containerDiv.scrollWidth+15
   var height=containerDiv.scrollHeight+30

   parent.sizeFrame('addElemBarGauge',width,height)


     if(parent.EditBarGauge==true)
        parent.setEditBarGauge()
        else
       parent.startBarGaugeDraw()

}


</script>
</html>